<#assign className = model.className>
<#assign classNameLower = className?uncap_first>
package ${basepackage}.${moduleName}.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

import tso.model.*;

/**
 * ${model.tableAlias}
 * @author codeGener
 * @version 1.0
 * @created ${now?string("yyyy-MM-dd HH:mm")}
 */
@Entity
@Table(name = "${model.tableName}")
public class ${className} extends BaseModel implements Serializable{
	private static final long serialVersionUID = 1L;
	public ${className}(){}
	
<#-- ID生成策略 -->	
<#list model.columns as column>
<#if column.pk>
	@Id 
<#if idGenerType =="sequence">	
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="${sequenceName}")
	@SequenceGenerator(name="${sequenceName}", sequenceName="${sequenceName}",allocationSize=1)
<#else>
	@GeneratedValue(generator="${column.nameFirstUp}")
	@GenericGenerator(name="${column.nameFirstUp}", strategy="uuid")
</#if>
	<@generateColumnField column/>
</#if>
</#list>

<#-- 这里处理比较固定的属性 -->	
<#list model.columns as column>
<#if !column.pk>
	/**
	 * ${column.remarks}
	 */
<#if column.columnName == "VERSION_NO">
	@Version
	<@generateColumnField column/>
<#elseif column.columnName == "SEND_STATE">
	@Column(name = "${column.columnName}")
	private ${column.javaType} ${column.name} = "0";
<#elseif column.columnName == "MODIFY_TIME">
	@Column(name = "${column.columnName}")
	private ${column.javaType} ${column.name} =new Date();
<#elseif column.columnName == "DATA_STATE">
	@Column(name = "${column.columnName}")
	private ${column.javaType} ${column.name} = "1";
<#else>
	<@generateColumnField column/>

</#if>
</#if>
</#list>
	
//////////////////////////////////////////////////////////////////
//////////////////////getter and setter///////////////////////////

<#list model.columns as column>
	public ${column.javaType} get${column.nameFirstUp}() {
		return this.${column.name};
	}
	public void set${column.nameFirstUp}(${column.javaType} ${column.name}) {
		this.${column.name} = ${column.name};
	}
	
</#list>
}
<#macro generateColumnField column>
<#if column.columnName == "double">
	@Column(name = "${column.columnName}",precision=${column.size},scale = ${column.decimalDigits})
<#else>
	@Column(name = "${column.columnName}",length = ${column.size})
</#if>
	private ${column.javaType} ${column.name};
</#macro>